<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>Class: Spec::Story::Runner::StoryMediator</title>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <meta http-equiv="Content-Script-Type" content="text/javascript" />
  <link rel="stylesheet" href="../../../.././rdoc-style.css" type="text/css" media="screen" />
  <script type="text/javascript">
  // <![CDATA[

  function popupCode( url ) {
    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
  }

  function toggleCode( id ) {
    if ( document.getElementById )
      elem = document.getElementById( id );
    else if ( document.all )
      elem = eval( "document.all." + id );
    else
      return false;

    elemStyle = elem.style;
    
    if ( elemStyle.display != "block" ) {
      elemStyle.display = "block"
    } else {
      elemStyle.display = "none"
    }

    return true;
  }
  
  // Make codeblocks hidden by default
  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
  
  // ]]>
  </script>

</head>
<body>



    <div id="classHeader">
        <table class="header-table">
        <tr class="top-aligned-row">
          <td><strong>Class</strong></td>
          <td class="class-name-in-header">Spec::Story::Runner::StoryMediator</td>
        </tr>
        <tr class="top-aligned-row">
            <td><strong>In:</strong></td>
            <td>
                <a href="../../../../files/vendor/plugins/rspec/lib/spec/story/runner/story_mediator_rb.html">
                vendor/plugins/rspec/lib/spec/story/runner/story_mediator.rb
                </a>
        <br />
            </td>
        </tr>

        <tr class="top-aligned-row">
            <td><strong>Parent:</strong></td>
            <td>
                <a href="../../../Object.html">
                Object
               </a>
            </td>
        </tr>
        </table>
    </div>
  <!-- banner header -->

  <div id="bodyContent">



  <div id="contextContent">



   </div>

    <div id="method-list">
      <h3 class="section-bar">Methods</h3>

      <div class="name-list">
      <a href="#M000099">add_to_last</a>&nbsp;&nbsp;
      <a href="#M000094">create_given</a>&nbsp;&nbsp;
      <a href="#M000095">create_given_scenario</a>&nbsp;&nbsp;
      <a href="#M000093">create_scenario</a>&nbsp;&nbsp;
      <a href="#M000092">create_story</a>&nbsp;&nbsp;
      <a href="#M000097">create_then</a>&nbsp;&nbsp;
      <a href="#M000096">create_when</a>&nbsp;&nbsp;
      <a href="#M000098">last_step</a>&nbsp;&nbsp;
      <a href="#M000090">new</a>&nbsp;&nbsp;
      <a href="#M000100">run_stories</a>&nbsp;&nbsp;
      <a href="#M000091">stories</a>&nbsp;&nbsp;
      </div>
    </div>

  </div>


    <!-- if includes -->

    <div id="section">

    <div id="class-list">
      <h3 class="section-bar">Classes and Modules</h3>

      Class <a href="StoryMediator/Scenario.html" class="link">Spec::Story::Runner::StoryMediator::Scenario</a><br />
Class <a href="StoryMediator/Step.html" class="link">Spec::Story::Runner::StoryMediator::Step</a><br />
Class <a href="StoryMediator/Story.html" class="link">Spec::Story::Runner::StoryMediator::Story</a><br />

    </div>




      


    <!-- if method_list -->
    <div id="methods">
      <h3 class="section-bar">Public Class methods</h3>

      <div id="method-M000090" class="method-detail">
        <a name="M000090"></a>

        <div class="method-heading">
          <a href="#M000090" class="method-signature">
          <span class="method-name">new</span><span class="method-args">(step_group, runner, options={})</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000090-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000090-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/rspec/lib/spec/story/runner/story_mediator.rb, line 6</span>
 6:         <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">step_group</span>, <span class="ruby-identifier">runner</span>, <span class="ruby-identifier">options</span>={})
 7:           <span class="ruby-ivar">@step_group</span> = <span class="ruby-identifier">step_group</span>
 8:           <span class="ruby-ivar">@stories</span> = []
 9:           <span class="ruby-ivar">@runner</span> = <span class="ruby-identifier">runner</span>
10:           <span class="ruby-ivar">@options</span> = <span class="ruby-identifier">options</span>
11:         <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <h3 class="section-bar">Public Instance methods</h3>

      <div id="method-M000099" class="method-detail">
        <a name="M000099"></a>

        <div class="method-heading">
          <a href="#M000099" class="method-signature">
          <span class="method-name">add_to_last</span><span class="method-args">(name)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000099-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000099-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/rspec/lib/spec/story/runner/story_mediator.rb, line 45</span>
45:         <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_to_last</span>(<span class="ruby-identifier">name</span>)
46:           <span class="ruby-identifier">last_step</span>.<span class="ruby-identifier">name</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">name</span>
47:         <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000094" class="method-detail">
        <a name="M000094"></a>

        <div class="method-heading">
          <a href="#M000094" class="method-signature">
          <span class="method-name">create_given</span><span class="method-args">(name)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000094-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000094-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/rspec/lib/spec/story/runner/story_mediator.rb, line 25</span>
25:         <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">create_given</span>(<span class="ruby-identifier">name</span>)
26:           <span class="ruby-identifier">current_scenario</span>.<span class="ruby-identifier">add_step</span> <span class="ruby-constant">Step</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value str">'Given'</span>, <span class="ruby-identifier">name</span>)
27:         <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000095" class="method-detail">
        <a name="M000095"></a>

        <div class="method-heading">
          <a href="#M000095" class="method-signature">
          <span class="method-name">create_given_scenario</span><span class="method-args">(name)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000095-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000095-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/rspec/lib/spec/story/runner/story_mediator.rb, line 29</span>
29:         <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">create_given_scenario</span>(<span class="ruby-identifier">name</span>)
30:           <span class="ruby-identifier">current_scenario</span>.<span class="ruby-identifier">add_step</span> <span class="ruby-constant">Step</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value str">'GivenScenario'</span>, <span class="ruby-identifier">name</span>)
31:         <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000093" class="method-detail">
        <a name="M000093"></a>

        <div class="method-heading">
          <a href="#M000093" class="method-signature">
          <span class="method-name">create_scenario</span><span class="method-args">(title)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000093-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000093-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/rspec/lib/spec/story/runner/story_mediator.rb, line 21</span>
21:         <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">create_scenario</span>(<span class="ruby-identifier">title</span>)
22:           <span class="ruby-identifier">current_story</span>.<span class="ruby-identifier">add_scenario</span> <span class="ruby-constant">Scenario</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">title</span>)
23:         <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000092" class="method-detail">
        <a name="M000092"></a>

        <div class="method-heading">
          <a href="#M000092" class="method-signature">
          <span class="method-name">create_story</span><span class="method-args">(title, narrative)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000092-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000092-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/rspec/lib/spec/story/runner/story_mediator.rb, line 17</span>
17:         <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">create_story</span>(<span class="ruby-identifier">title</span>, <span class="ruby-identifier">narrative</span>)
18:           <span class="ruby-ivar">@stories</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-constant">Story</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">title</span>, <span class="ruby-identifier">narrative</span>, <span class="ruby-ivar">@step_group</span>, <span class="ruby-ivar">@options</span>)
19:         <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000097" class="method-detail">
        <a name="M000097"></a>

        <div class="method-heading">
          <a href="#M000097" class="method-signature">
          <span class="method-name">create_then</span><span class="method-args">(name)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000097-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000097-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/rspec/lib/spec/story/runner/story_mediator.rb, line 37</span>
37:         <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">create_then</span>(<span class="ruby-identifier">name</span>)
38:           <span class="ruby-identifier">current_scenario</span>.<span class="ruby-identifier">add_step</span> <span class="ruby-constant">Step</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value str">'Then'</span>, <span class="ruby-identifier">name</span>)
39:         <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000096" class="method-detail">
        <a name="M000096"></a>

        <div class="method-heading">
          <a href="#M000096" class="method-signature">
          <span class="method-name">create_when</span><span class="method-args">(name)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000096-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000096-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/rspec/lib/spec/story/runner/story_mediator.rb, line 33</span>
33:         <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">create_when</span>(<span class="ruby-identifier">name</span>)
34:           <span class="ruby-identifier">current_scenario</span>.<span class="ruby-identifier">add_step</span> <span class="ruby-constant">Step</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value str">'When'</span>, <span class="ruby-identifier">name</span>)
35:         <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000098" class="method-detail">
        <a name="M000098"></a>

        <div class="method-heading">
          <a href="#M000098" class="method-signature">
          <span class="method-name">last_step</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000098-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000098-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/rspec/lib/spec/story/runner/story_mediator.rb, line 41</span>
41:         <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">last_step</span>
42:           <span class="ruby-identifier">current_scenario</span>.<span class="ruby-identifier">last_step</span>
43:         <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000100" class="method-detail">
        <a name="M000100"></a>

        <div class="method-heading">
          <a href="#M000100" class="method-signature">
          <span class="method-name">run_stories</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000100-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000100-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/rspec/lib/spec/story/runner/story_mediator.rb, line 49</span>
49:         <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">run_stories</span>
50:           <span class="ruby-identifier">stories</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">story</span><span class="ruby-operator">|</span> <span class="ruby-ivar">@runner</span>.<span class="ruby-identifier">instance_eval</span>(<span class="ruby-operator">&amp;</span><span class="ruby-identifier">story</span>) }
51:         <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000091" class="method-detail">
        <a name="M000091"></a>

        <div class="method-heading">
          <a href="#M000091" class="method-signature">
          <span class="method-name">stories</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000091-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000091-source">
<pre>
    <span class="ruby-comment cmt"># File vendor/plugins/rspec/lib/spec/story/runner/story_mediator.rb, line 13</span>
13:         <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">stories</span>
14:           <span class="ruby-ivar">@stories</span>.<span class="ruby-identifier">collect</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">p</span><span class="ruby-operator">|</span> <span class="ruby-identifier">p</span>.<span class="ruby-identifier">to_proc</span> }
15:         <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>


    </div>


  </div>


<div id="validator-badges">
  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>

</body>
</html>